package com.fts.fts.fitness_tracking_system.controller;

import com.fts.fts.fitness_tracking_system.pojo.VideoDetailDTO;
import com.fts.fts.fitness_tracking_system.service.VideoService;
import com.fts.fts.fitness_tracking_system.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/videos")
public class VideoController {
    @Autowired
    private VideoService videoService;

    /**
     * 获取视频详细信息
     *
     * @param videoId 路径参数
     * @return 视频详情（包含分段信息）
     */
    @GetMapping("/videoDetail")
    public Result<?> getVideoDetail(@RequestParam Integer videoId) {
        VideoDetailDTO videoDetail = videoService.getVideoDetail(videoId);
        return new Result<>(200, "获取成功", videoDetail);
    }

}
